home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
qtools.arc
/
QCP208.ARC
/
QCP.DOC
< prev
next >
Wrap
Text File
|
1990-08-24
|
86KB
|
1,947 lines
QCP -- QEdit Compiler Program
A program to ease invocation of compilers
and other software tools from a function key in
QEdit version 2
Author: Tim Farley
Revision: 2.08
Date: November 17th, 1989
QCP is FREE to licensed users of QEdit
QCP is Copyright (C) 1989, by Tim Farley
QEdit and QMac are Copyright (C) 1985-1989 by SemWare.
DESCRIPTION
-----------
QCP is a program to run compilers & other utilities from within
QEdit 2.08+. You hit a function key in QEdit, QCP decides which
program to run based on the name of the file you are editing,
runs it, and then "reads" the error messages from the compiler to
tell QEdit how to jump to the errors in your source code.
QCP can also be used to provide a regular expression search
capability to QEdit in the same way--simply by running an
external GREP program, and "reading" its output.
QCP can also be used from the command line or within a batch
file, separate from QEdit, to provide a single front-end to
several different compilers or utilities.
QCP can interface in the same manner to any external utility that
generates redirectable output containing "line numbers" that
refer to your original source file.
QCP 2.08 requires the use of QEdit 2.08 or higher.
In addition, to take full advantage of QCP, you will want to have
a copy of QMAC that is compatible with your copy of QEdit. If
you are a registered user of QEdit, then QMAC should be found on
the Program Diskette that you received from SemWare.
QCP 2.08 Documentation Page 2
TABLE OF CONTENTS
-----------------
Description ................................................ 1
Table Of Contents .......................................... 2
File List .................................................. 3
License .................................................... 4
Quick Installation ......................................... 4
Quick Start ................................................ 6
Running QCP ................................................ 6
Command Line Switches and QCP .............................. 8
/R -- Read Config Info from Disk ...................... 9
/C -- Configure QCP.EXE's Defaults .................... 9
/S -- Show QCP.EXE's Current Defaults ................. 10
/G -- Guessing of File Extension ...................... 10
/Q -- QEdit Macro Creation ............................ 10
/B -- Batch Mode Operation ............................ 10
/W -- Write New Error Output File ..................... 11
/P -- Pause After Error ............................... 11
/I -- Insertion Character ............................. 12
/O -- Output File Name ................................ 12
/M -- Macro File Name ................................. 12
/1 to /9 -- Custom File Extensions .................... 13
file -- File to Compile ............................... 13
options -- Compiler Options ........................... 13
QEdit Macro Key Customization .............................. 14
Compiler Compatibility ..................................... 15
Custom Compiler Configurations ........................ 15
Compatible Compilers .................................. 16
I/O Redirection Problems, Tips ........................ 18
Microsoft Fortran 3.x ............................ 19
Microsoft MASM 4.0 ............................... 20
DBFAST 1.03 ...................................... 20
Norton Guides Database Compiler 1.04 ............. 21
Microsoft Quick Pascal 1.00 ...................... 21
Incompatible Compilers ................................ 22
Configuration Via QCP.DAT .................................. 22
Substitution Strings .................................. 24
$F -- Full Filename .............................. 24
$D -- Drive Letter ............................... 24
$P -- Path (Directory) of File ................... 24
$N -- Name of File ............................... 24
$E -- Extension of File .......................... 24
$1 to $9 -- Compiler Options ..................... 25
$$ -- Single Dollar Sign ......................... 25
$T -- Temp File Name ............................. 25
$O -- Output File Name ........................... 25
$M -- Macro File Name ............................ 25
$K -- Macro Key Number ........................... 25
$S -- Source Line Number ......................... 26
$C -- Source Column Number ....................... 26
QCP 2.08 Documentation Page 3
$R -- Result Line Number ......................... 26
$I -- Inserted Character ......................... 26
$U -- Unique String .............................. 26
$L -- Lead-in String ............................. 27
QCP Configuration Commands ............................ 27
..T -- Temp File Name ............................ 27
..O -- Output File Name .......................... 28
..M -- Macro File Name ........................... 28
..C -- QMac Command Line ......................... 28
..Q -- QEdit Macro Template ...................... 29
..1 to ..9 -- Special File "Extensions" .......... 30
..B -- Batch Mode Startup Macro Template ......... 31
..G -- Guess Extension ........................... 32
..W -- Rewrite Error File ........................ 32
..I -- Insertion Character ....................... 32
..N -- Next Error Macro Template ................. 33
..P -- Previous Error Macro Template ............. 33
Summary of Command Line Switches ........................... 34
Summary of Substitution Strings ............................ 34
Summary of Configuration Commands .......................... 35
Error Messages ............................................. 35
Informative & Warning Messages ............................. 37
Acknowledgements & Contacts ................................ 38
Revision History ........................................... 39
FILE LIST
---------
The following files are included in this package:
QCP-READ.ME - quick notes on this update.
QCP.DOC - this documentation file
QCP.EXE - the QCP program
QCPSMALL.EXE - another version of QCP with /R and /C
disabled. For those worried
about disk and RAM usage.
QCP.DAT - the configuration data file
QCONFIG.QCP - partial QEdit keyboard file containing
sample macros for use with QCP
COMPILE.BAT - example of using QCP outside QEdit
NOTE: Changes in this manual from the last version, 2.0, are |
notated in the right margin with a "|" character. |
QCP 2.08 Documentation Page 4
LICENSE
-------
QCP is FREE to licensed users of QEdit.
You may copy QCP for purposes of evaluating it, and distribute
QCP to others for purposes of evaluating it for their use. If
you continue to use QCP after evaluating it, you must register
your copy of QEdit. See your QEdit documentation for
registration information.
If you distribute QCP to others, you must distribute it AS-IS,
with no files altered, added, or removed from the package. You
may not distribute QCP in connection with any other product or
service, or for any consideration or 'disk fee'.
Operators of electronic bulletin board systems (Sysops) are
encouraged to post QCP downloading by their users, as long as the
above conditions are met. Those who have permission from SemWare
to distribute or sell QEdit itself are exempt from these
restrictions.
The author assumes no liability for the use of QCP, and does not
guarantee its fitness for any purpose whatsoever.
QUICK INSTALLATION
------------------
If you are upgrading from QCP 2.0 or QCP 1.0, see the file |
QCP-READ.ME for info on changing your configuration. Otherwise, |
follow the instructions below: |
STEP 0
------
Set aside your original copies of all the QCP files in a safe
place. Always work on a copy, not the original!
STEP 1
------
PUT QCP.EXE AND QCP.DAT IN A CONVENIENT DIRECTORY ON YOUR DISK.
QCP.EXE should exist somewhere along your current PATH statement
so that it can be executed easily. QCP.DAT can exist in one of
three places: (1) the current directory, (2) the same directory
that QCP.EXE is in, or (3) somewhere along your current PATH
statement. It is searched for by QCP in that order.
If you are going to use the macro creation feature of QCP, and
this is highly recommended, then make sure QMAC.EXE is accessible
QCP 2.08 Documentation Page 5
along your PATH as well.
We recommend keeping QCP.EXE (and QCP.DAT, if you use the /R
option) as well as QMAC.EXE on a RAMdisk, and listing that
RAMdisk drive letter first in your PATH= environment variable.
This allows QCP to operate very rapidly, even on relatively
"slow" systems.
STEP 2
------
EDIT QCP.DAT TO SUIT THE FILE EXTENSION(S) YOU USE AND THE
COMPILER OR UTILITY PROGRAM THAT SHOULD BE INVOKED FOR EACH ONE.
There are comments in the supplied QCP.DAT to help you
remember the syntax of commands, as well as several sample
command lines for popular compilers. See also the section on
configuration below for more details on other compilers.
It is assumed that the command line you specify for your compiler
will redirect the error messages from the compiler to a file, by
default called ERRORS.LST. This file can then be loaded into
QEdit for viewing, but more importantly it is read by QCP in
order to construct QEdit macros that will move your cursor to
each error in your file. So, typically each command line you use
in QCP.DAT should end with ">$O", which causes the output to be
redirected to the error file. Use the /O command line switch, or
the ..O command in QCP.DAT, to assign the filename that will be
substituted for $O.
If this is the only configuration you are going to use, you will
probably want to "install" these options into your copy of
QCP.EXE permanently by typing "QCP /C" at a DOS prompt. If you
want to use QCPSMALL to save memory, use QCP.EXE to install it by
typing QCP /Cqcpsmall.exe at a DOS prompt. You can rename
QCPSMALL.EXE if you wish.
STEP 3
------
ADD THE MACRO DEFINITION(S) FROM QCONFIG.QCP INTO YOUR
QCONFIG.DAT, AND USE QCONFIG TO INSTALL THESE KEY(S) INTO YOUR
COPY OF QEDIT.
Note that the default macro is set up to always create and read
the ERRORS.LST and ERRORS.MAC file in the CURRENT directory. If
you have a RAM disk or other fast disk drive, you will probably
want to edit the macro definition to put these files there.
QCP 2.08 Documentation Page 6
Within the macro, the /O and /M command line switches for QCP are
used to make sure the filenames match. You may want to configure
these filenames into QCP permanently, and remove the references
to /O and /M in the macro definition.
QUICK START
-----------
Edit a file for which you created a definition in QCP.DAT. I.e.,
if you defined something for .C, then edit TEMP.C. Put in a
deliberate syntax error, something that you know the compiler
will generate an error message for. Save the file to disk.
Now, hit the function key you assigned in QCONFIG.DAT. QEdit
will shell out, run QCP, which will run your compiler. Errors
will be redirected to ERRORS.LST, and macros created. When you
return to QEdit, your file will be in the top window, and your
error messages will be in the bottom.
If your chosen compiler generates compatible error messages (see
Compiler Compatibility, below), you will be able to hit Alt-1
through Alt-0 to move to each of the errors your compiler issued,
both in the source and output windows. Or, if you are using the |
/W+ mode (rewrite error file), you should be able to just hit |
Shift-F10 to step to each successive error message. |
And that's all there is to it!
There are some other features of QCP you may want to take
advantage of, read on to find out about those, as well as how to
configure QCP's behavior to suit your specific needs.
RUNNING QCP
-----------
The flow of operation of QCP generally works like this:
1. User hits "compile" macro key. QEdit shells
out and runs QCP.
2. QCP picks a compiler command line based on the name of
the file passed along by QEdit. The compiler is
executed.
3. The compiler does it's job, writing any error messages
to the error file specified by QCP. (ERRORS.LST)
QCP 2.08 Documentation Page 7
4. QCP regains control, reading the error file (if any)
which was written by the compiler (ERRORS.LST). If it
can locate error messages, it writes text macros to the
temp file specified ($QCP$.TMP). It then invokes QMAC.
5. QMAC converts the text macros to binary macros that can
be loaded by QEdit. ($QCP$.TMP becomes ERRORS.MAC).
6. QCP regains control, and exits to QEdit.
7. QEdit loads the error output from the compiler
(ERRORS.LST) into a window so the user can see the
result, and loads the macro file (ERRORS.MAC) if it
exists, produced by QMAC so that error messages can be
found with single keystrokes.
It actually runs quite quickly, as long as you make sure the
necessary files are easily accessible. If you are concerned
about the speed of operation, the generation of QEdit macros can
be disabled (See /Q).
If you are having trouble getting QCP to work as described, more
than likely your file names are getting out of sync. Please make
sure that the file names (1) in your QEdit macro key, (2) in QCP
itself, and (3) in any batch files you use to run compilers; all
agree as to where and under what name each file is placed.
Also, when compiling this way, a pretty good bit of RAM is
required, all told. This is because QEdit, your source file,
QCP, and your compiler (not to mention a couple copies of the
stub portion of COMMAND.COM) are all in memory at the same time.
If you have very large source files, or very little free RAM, you
may have trouble running QCP from a QEdit function key. If so,
then take a look at COMPILE.BAT. It demonstrates the use of QCP
from the DOS command line.
QCP 2.08 Documentation Page 8
COMMAND LINE SWITCHES AND QCP
-----------------------------
If you just type QCP at a DOS prompt, it will respond with this
screen of info. (Display of defaults removed here to fit the
screen on a normal page):
----------------------------------------------------------------
QCP: QEdit Compiler Program x.yy dd-mmm-yyyy
Copyright (C) 1989, Tim Farley. All Rights Reserved.
QCP /R[file] /C[file] /S /G /Q /B /W /P /Ichar /Ofile /Mfile /# FILE opts...
/R Reads configuration info from specified file.
/C Configures defaults into specified copy of QCP.
/S Shows QCP's current configurable defaults
/G+ /G- Guess or don't guess a missing file extension
/Q+ /Q- Create or don't create a QEdit binary macro file
/B+ /B- Batch mode: create autoexec macro for QEdit |
/W+ /W- Write or don't write copy of error file |
/P+ /P- Pause or don't pause for keystroke after an error |
/Ichar Char to be Inserted before row/col in output
/Ofile File to which Output will be redirected
/Mfile QEdit Macro file name to be generated
/# i.e. /1 thru /9, uses the specified special
extension definition instead of the file's extension
FILE is source file to compile.
opts are options to be passed to compiler commmand line
/R, /C, and /S are mutually exclusive
If none of them are present, internal defaults are used
----------------------------------------------------------------
All QCP switches MUST precede the file name. Both "/" and "-"
are recognized as switch characters. However, each switch must be
preceded by its own switch character. Each switch must be
separated from the others by at least one space.
The switches that contain file names (/M and /O, optionally on /C
and /R) MUST NOT contain a space between the switch and the file
name.
The boolean switches, like /G and /Q, can have "+" or "-" behind |
them to set the specified switch on or off. If nothing is behind |
the switch, it is set on. If any character other than "+" or "-" |
is behind a boolean switch, for instance "=", then the current |
value is TOGGLED. |
QCP 2.08 Documentation Page 9
QCPSMALL includes all the capabilities of QCP, EXCEPT the /R and
/C options. As such, you MUST use QCP.EXE to install defaults
from your QCP.DAT into QCPSMALL.EXE (see details on the /C option
below). The advantage of QCPSMALL is that it takes about 6K less
disk space and RAM. It is designed for those who are sticklers
about disk and RAM usage. Its help display will be a slightly
abbreviated version of the above.
/R -- READ CONFIG INFO FROM DISK
---------------------------------
When /R is present, QCP will always read its configuration data
from an external file, overwriting the internal defaults.
QCPSMALL does not support this option.
If you specify a file specification (which can include a path)
immediately after /R, that file will be read instead of QCP.DAT.
An extension of '.DAT' is added if none was present.
Network users especially may wish to make use of the /R option if
the normal location for QCP.EXE is on your server, and you do not
have write permission on that directory.
If using the default file name, or if the file name specified
does not contain a specific path specification, QCP searches for
it in the following way: first in the current directory, then
(if DOS 3.0 or higher is present) in the directory from which
the program loaded, then down each of the directories in your
PATH= statement.
/C -- CONFIGURE QCP.EXE'S DEFAULTS
-----------------------------------
The /C option causes QCP to read its configuration data from
QCP.DAT, and install this info as new defaults into QCP.EXE.
This allows you to permanently customize your copy of QCP.
A /R is implicit in the use of /C. However, you can use /R on
the command line BEFORE /C to choose the configuration file.
If you specify a file specification (possibly including a path)
immediately after /C, that file will be configured instead of
QCP.EXE. An extension of '.EXE' is added if none was present.
This must be a copy of the same version of QCP that you are
running. This is how you can install your copy of QCPSMALL.EXE.
QCP searches for its EXE file in the same way it searches for the
data file. If a path specification is present, then the file
will only be searched for there.
QCP 2.08 Documentation Page 10
Please be aware that since /C writes data into the EXE file, it
is possible for your copy of QCP to be damaged by this operation.
Make sure you always have a clean, uninstalled copy of QCP safely
tucked away.
In operation on networks, you may not wish to use the /C option,
if QCP.EXE will be located on a server drive to which you do not
have write access. See /R above.
/S -- SHOW QCP.EXE'S CURRENT DEFAULTS
--------------------------------------
The /S option is a companion to /C. It allows you to see the
current defaults installed into QCP.EXE.
Note that /R, /C and /S are mutually exclusive. If you combine
them on a command line, the last one specified will take control.
/G+ or /G- -- GUESSING OF FILE EXTENSION
-----------------------------------------
Normally, if no '.' appears in the file name to compile, QCP will
attempt to guess the correct extension just as QEdit does when
loading files into memory. The extensions are guessed in the
same order that they are defined in QCP.DAT.
This is mainly for those using QCP from the DOS command line, to
save typing. The /G option can be used to enable or disable this
feature. Mainly you would use this if you have files with no
extension, and you have an entry for this in QCP.DAT.
The default value for filename guessing is controlled by the
"..G" command in QCP.DAT. The release version has it turned ON.
/Q+ or /Q- -- QEDIT MACRO CREATION
-----------------------------------
The /Q switch allows you to turn macro creation on or off without
reconfiguring QCP. /Q+ activates macro creation, /Q- deactivates
it.
The default value for macro creation is controlled by the "..Q"
command in QCP.DAT. The release version has it turned ON.
/B+ or /B- -- BATCH MODE OPERATION |
----------------------------------- |
The /B switch controls use of QCP in a "batch mode" such as in |
COMPILE.BAT. When batch mode is activated, an extra macro key is |
written first in the QEdit macro file. This macro key is used as |
an "auto execute" macro via the QEdit /E command line switch. |
COMPILE.BAT is supplied as a sample of how this works. |
QCP 2.08 Documentation Page 11
The batch mode macro is constructed by QCP when it locates the |
first error line in the compiler output, so the expansion strings |
$S, $R, $C, $K, $U, and $L all have valid meanings at the time |
this macro is constructed. |
The default value for batch mode, as well as the type of macro |
created, is controlled by the "..B" command in QCP.DAT. The |
release version has it turned ON, with a macro set up to work |
with COMPILE.BAT. |
/W+ or /W- -- WRITE NEW ERROR OUTPUT FILE |
------------------------------------------ |
The /W switch controls whether QCP will write a new copy of the |
compiler output file (normally ERRORS.LST). The purpose of this |
is to insert a certain ASCII character (see /I or ..I) |
immediately to the left of the row and column numbers that QCP |
found in the compiler output. |
This allows the "next error" and "previous error" macro keys to |
find row numbers and column numbers without having any special |
knowledge of how the error messages are formatted. |
Since this involves writing a new copy of ERRORS.LST, it can slow |
down the process somewhat, hence the flag to turn it off. If you |
are happy with using the Alt-numeric keys to jump to the first |
ten errors, you can turn this option off and save a little time. |
However, if you use a compiler that generates large numbers (more |
than 10 or 12) of error messages; or if you wish to use the GREP |
macro in QCONFIG.QCP to its full advantage; leave this option |
turned ON. Note: the Next Error Macro and the Previous Error |
Macro (see ..N and ..P respectively) are not written to the macro |
file by QCP unless this option is turned on. |
The default for writing a new error file is controlled by the |
"..W" command in QCP.DAT. The release version has it turned ON. |
/P -- PAUSE AFTER ERROR |
------------------------ |
When invoking QCP from a QEdit macro key, it can happen that QCP |
issues an error message, and QEdit clears it off the screen and |
returns to the editing session so quickly that you do not see it. |
The /P option allows you to cause QCP to pause and ask you to |
"Press any key to continue" when it encounters a fatal error |
condition. |
QCP 2.08 Documentation Page 12
/I -- INSERTION CHARACTER |
-------------------------- |
The /I option lets you control what character will be inserted |
into the rewritten output file, just to the left of the row and |
column number. This only occurs if /W is set to ON (see |
description of /W above). The insertion character allows the |
next error and previous error macros to operate. |
It is very important that you pick an insertion character that |
does not appear anywhere else in your error output. |
The character to set should appear IMMEDIATELY to the right of |
/I. If the first character after /I is numeric, then the |
information is treated as a decimal ASCII code. If it is not |
numeric, then the character is taken directly. |
The default for insertion character is controlled by |
the "..I" command in QCP.DAT. The release version has it set to |
CHR( 255 ), which displays as a blank space. |
/O -- OUTPUT FILE NAME
-----------------------
The /O option lets you specify the Output file name that will be
used by QCP. This filename is substituted for "$O" (see below)
if present on your target compiler command lines. This is also
the file that QCP will read back in after the compiler runs, to
attempt to locate any error messages.
The Output file name can also be configured with the "..O"
command in QCP.DAT, however if /O is present it will override the
value specified in QCP.DAT.
The /O command line option is intended so that the filenames used
can be completely controlled by your QEdit function key macro.
/M -- MACRO FILE NAME
----------------------
The /M option is similar to /O, except it controls the name of
the binary macro file created by QCP and QMAC for use in finding
errors in your source code. This file name is replaced wherever
"$M" appears in your target command line(s).
The macro file name can also be configured using the "..M"
command in QCP.DAT, however if /M is present it will override the
value specified in QCP.DAT.
On both of the above files, QCP will look for an environment
variable called TMP, to determine a suitable place to put "temp"
files. This is the same as most Microsoft utilities which will
use the TMP environment variable to locate your RAM disk for
QCP 2.08 Documentation Page 13
their use in writing scratch files. If you invoke QCP with the
/S switch, you will see the result of this when the three file
names are listed.
You may not want this to happen, especially if you want to insure
that the file names referred to in your QEdit macro key are the
same as those used by QCP. If so, just include a drive and/or
path specification in the file name. If you want them always to
be in the "current" directory, then use ".\" prior to each file
name.
/1 through /9 -- SPECIAL CUSTOM FILE EXTENSIONS
------------------------------------------------
The number options let you override the command line selection
that QCP would normally make based on the extension of the file
you are editing. This is intended so that you can define other
QEdit function keys, that invoke text search or other utilities
on any arbitrary file, regardless of its name.
A sample of this, using GREP, is supplied. This is also the mode
in which QCP can replace the function of the QMAKE utility. See
examples in in QCP.DAT and QCONFIG.QCP.
FILE -- FILE TO COMPILE
------------------------
The first non-switch parameter on the QCP command line is assumed
to be the file you wish to compile. This is normally generated
using "CurrentFilename" in a QEdit macro key, but could be typed
by you. This can be a full file specification including path.
options -- COMPILER OPTIONS
----------------------------
Any parameters past the filename on the QCP command line are
assumed to be options for the target compiler's command line.
They are simply passed along, assuming you have put the
appropriate $1, $2 etc. strings on your compiler command line
templates in QCP.DAT.
All of these options must be delimited on both sides by spaces.
Note that this is a restriction of QCP that might not be shared
by your compiler.
QCP 2.08 Documentation Page 14
QEDIT MACRO KEY CUSTOMIZATION
-----------------------------
QCP is normally intended to be invoked from a QEdit macro key. A
sample key is provided in QCONFIG.QCP, and is repeated here. We
use Control-F9 in this example, you could use any key.
^f9 MacroBegin SaveFile OneWindow UnmarkBlock MarkLine |
EditFile 'errors.lst' Return Quit |
GotoBlockBeg UnmarkBlock |
Dos 'QCP/O.\errors.lst /M.\errors.mac ' |
CurrentFilename Return " " |
HorizontalWindow EditFile Return PrevWindow |
MacroRead 'errors.mac' Return |
The macro definition above is word-wrapped for readability,
normally in QCONFIG.DAT it would appear all on one line.
You may want to customize this macro, so a little explanation of
how it works may be in order. The first line simply clears any
split windows off the screen, and marks a one-line block in
your source file, so we can get back there. The second line
makes sure that any previous compiler output file is purged from
QEdit's ring. The third line returns us to our source file and
clears the mark we created.
The fourth and fifth lines do the main work, invoking QCP with the
current filename as its main parameter. Notice that /O and /M are
used to insure that the filenames used in the macro stay in sync
with those used by QCP.
The sixth line splits the screen and brings up the error output
file in the lower window, and the seventh line reads in the
macros created by QCP, so you can jump from error to error.
In QCP 1.0, we redirected the output from QCP in the macro key
itself, i.e. "QCP current_filename >ERRORS.LST". In QCP 2.x you
definitely DO NOT want to do that, or it will prevent the
creation of macro keys by QCP.
Create your compiler command lines in QCP.DAT to do the
redirection there, or if you are invoking your compiler from a
batch file, do the redirection inside the batch file. One
advantage of this is that you will see the output from QCP (and
QMAC, if applicable) on the screen, even though your compiler is
redirected to disk.
QCP 2.08 Documentation Page 15
COMPILER COMPATIBILITY
----------------------
The macro creation feature of QCP hinges on QCP's ability to read
the error messages created by your compiler. By default, QCP
assumes that your compiler issues error messages in this form:
<text> FILENAME.EXT <non-numeric chars> XX <text> YY <message>
where XX is the number of the source line on which the error
occurred, and YY is the column number on that line.
The default case allows for error messages similar to:
FILENAME.EXT (ROW,COL): MESSAGE
FILENAME.EXT: ROW: MESSAGE
"FILENAME.EXT", ROW COLUMN: MESSAGE
D:\PATH\FILENAME.EXT(ROW): MESSAGE
Most all of CURRENT VERSIONS of the compilers put out by
Microsoft Corporation, and Borland International, and every C
compiler we know of, can be made to issue error messages in this
form, and thus will work fine by default.
However, QCP allows you to configure the "unique string" (which
uniquely identifies error message lines), and the "lead-in
string" (which precedes the line number) for each compiler
command line. This allows you to adapt its behavior to compilers
which do not include the file name in the error message line, or
which do not put the line number first after the file name.
CUSTOM COMPILER CONFIGURATIONS
------------------------------
Non-standard compilers can still be handled by the appropriate
configuration line in QCP.DAT. The syntax for this is as follows:
.ext "command line" "unique string" [ "lead-in string" ]
Either single or double quotes can be used, but they must match
on either end of a given string. If you need to include a quote
mark inside one of the strings, use the other type of quote mark
to delimit it. Any number of commas and/or spaces (if present)
between the strings will be ignored.
Command line is the normal compiler command line that would have
been on the line by itself.
QCP 2.08 Documentation Page 16
The unique string is some string that is found in the compiler's
output ONLY in error message lines. This typically might be
something like "***ERROR:", you will have to consult your
compiler manual for likely candidates.
The lead-in string, if present, specifies a string that will
always be found in an error line to the left of the source line
number. It is not mandatory, if not present it will default to
the same thing as the unique string. The first numeric
characters to the right of the lead-in string must be the line
number. Keep in mind that the file name itself, the error
message, or the line of source code itself (if echoed as part of
the error message) might contain numeric characters that could be
misinterpreted as a line number.
Maximum length of the unique and lead-in strings is 16 characters
each, they will be truncated if longer. You CAN include
substitution strings like $N and $F inside the unique string and
lead-in string. The length limitation DOES NOT apply to the
strings AFTER they are expanded. The strings ARE NOT case
sensitive when matching occurs.
Example:
Your compiler generates error messages like:
***ERROR: Syntax error on line 34
You would set your unique string to "***ERROR" and your lead-in
string to "line".
Choose your strings carefully, as some compilers generate very |
inconsistent looking error messages. A common mistake is to try |
to key off the word "error" in the message, which will then cause |
QCP to ignore "warning" messages. |
COMPATIBLE COMPILERS
--------------------
Below are some cases of specific compilers, and the command line
switches or other actions necessary to make them conform to what
QCP is expecting. In many cases, you will want to add or
subtract switches to or from the sample command lines. Consult
your compiler manual.
QCP 2.08 Documentation Page 17
Most compilers allow you to specify either just a simple file
name, or a complete path specification on the command line. Keep
this in mind when selecting whether to use $F, or $N, or $N.$E,
etc. for your filename on the command line. The way you specify
the source file name on the command line, can affect how the
compiler echoes it in error messages. You may want to experiment
with this, if you are defining specific unique or lead-in strings
that involve the filename.
If your compiler is not covered in this section, see the section
"error message strings" below for information on how to build
your own configuration from scratch.
COMPILER LINE TO PUT IN QCP.DAT
------------------------- -------------------------------
Clipper by Nantucket, 8/87 .prg "clipper $N >$O","line " |
FoxBase Compiler v2.1 .prg "foxpcomp -e $F >$O","Error in line " |
FST Modula-2 v2.0a .mod "m2comp $F >$O","File: $F",", Line"
Microsoft Assembler 5.x .asm masm $F; >$O
Microsoft BASIC .bas bc /Z $F; >$O
Microsoft C 5.x .c cl /c /W3 $F >$O
Microsoft FORTRAN 4.0 .for fl /c $F >$O
Microsoft Menu Maker v1.2 .def "makemenu $N >$O","Error (" |
Microsoft Pascal 4.0 .pas pas1 /H $F; >$O
Alternative: .pas pl /c /Zz $F >$O
Microsoft Quick C 1.01 .c qcl $F >$O |
QMac (QEdit macros) 2.x .qm "qmac $N.mac $F /B /A- >$O" "QMAC " |
Telix 3.x Script Compiler .slt cs $F >$O
TopSpeed Modula-2 1.14 .mod m2 /c $F >$O |
Turbo Assembler 1.00 .asm "tasm $F >$O" "** $F" |
Turbo C 2.0 .c tcc -c -w $F >$O
Turbo Pascal 4.0 & 5.0 .pas tpc /q $F >$O
Watcom C 6.5 .c wcl /c $F >$O |
NOTES:
The /H switch for Microsoft Pascal is undocumented.
The Microsoft BASIC and FORTRAN, Clipper and FoxBase command
lines have not been tested by us personally.
Microsoft Menu Maker comes with the Microsoft Mouse. |
We recommend you use the /W+ option when working with |
Clipper, because of the way that Clipper writes its |
output. |
QCP 2.08 Documentation Page 18
Many compilers will compile files other than the one specified, |
due to an automatic "make" function built into the compiler. |
This can sometimes result in either (1) QCP ignoring error |
messages from the compiler, because they don't pertain to the |
current file or (2) QCP jumping to erroneous error lines in the |
current file, because it was unable to distinguish that they did |
not pertain to the current file. Some of the compilers that are |
prone to this are Clipper, Turbo Pascal, both of the Modula-2 |
compilers, and others. We plan to address this in a future |
version of QCP. |
Below are some instances where just a simple command line will
not do the trick. Even if you do not use one of them, you may
want to read through them to see what kinds of configuration
tricks are possible.
I/O REDIRECTION PROBLEMS, TIPS |
------------------------------ |
Many of the unusual compiler configurations listed below result |
from problems redirecting the output to the compiler. If a |
program writes its screen output to the "Standard Output Device" |
under DOS, then the text can be redirected normally, using the |
">" character followed by a filename on the dos command line. |
However, if the output is written to the "Standard Error Device", |
redirection is impossible using DOS alone. |
We know of two utilities that can assist with compilers that use |
Standard Error to display error messages. One is ERROUT.EXE, |
which is a utility Microsoft ships with many of its recent |
compiler products. |
The other is CONCOPY.EXE, which is a Freeware product by |
Christopher J. Dunford and The Cove Software Group. |
Microsoft's ERROUT.EXE allows you to redirect just the Standard |
Error device to a file. The syntax is as follows: |
ERROUT /f filename command_line |
where filename is the file to which to redirect Standard Error, |
and command_line is a DOS command line to execute while the |
redirection is in effect. The /f must be lower case, and there |
must be a space between it and the filename. |
Cove Software's CONCOPY will also redirect Standard Error, as |
well as Standard Output, and it has the additional effect that |
the output will appear on the screen while it is also redirected. |
This can be very useful if you have compilers that take a great |
deal of time to run, because you will be able to see their run- |
QCP 2.08 Documentation Page 19
time messages on the screen, even while they are redirected to |
disk. Here is the syntax: |
CONCOPY filename command_line |
where filename is again the file to which redirection should |
occur, and command_line is the normal compiler command line. You |
will need CONCOPY version 1.10 (10/11/88) or later to use this |
syntax. You can get CONCOPY version 1.10 on most IBM-oriented |
BBS's, including the SemWare QEdit Support Board. |
CONCOPY will allow console output to appear on the screen even |
while it is redirected. For this reason, you may wish to use |
CONCOPY even with compilers that DO NOT need redirection |
assistance, in order to see the error messages on the screen. |
If you do use CONCOPY with all your compiler configurations, we |
recommend that you DO NOT use normal I/O redirection in addition. |
In other words, use EITHER "CONCOPY $O" at the beginning OR ">$O" |
at the end of your compiler command lines, but NOT BOTH. |
See the sections below for examples of the use of ERROUT and |
CONCOPY with QCP. |
MICROSOFT FORTRAN 3.x
---------------------
Microsoft Fortran 3.x can work with QCP. Its error messages look
like this:
***** Error XXX,line YY -- ERROR MESSAGE
To get this, we define the unique string and lead-in string as
follows:
.FOR "for1 $N.$E; >$O","*****",",line "
You may wish to put this command line in a batch file instead of
invoking it directly, so that you can call up PAS2 and PAS3 of
the compiler as needed. If so, be sure to pass $O to the batch
file as a command line parameter.
QCP 2.08 Documentation Page 20
MICROSOFT MASM 4.0
------------------
Masm produces compatible error messages by default.
Unfortunately, MASM 4.0 writes the error messages to Standard
Error, so we have to use a utility to redirect it (see above).
Put one of these two lines in your QCP.DAT:
.ASM ERROUT /f $O MASM $N.$E;
.ASM CONCOPY $O MASM $N.$E; |
The part to the left of MASM causes Standard Error to be redirected to
the output file.
Later versions of MASM write to Standard Output.
DBFAST 1.03
-----------
This dBASE III+ compatible compiler does not generate error
messages compatible with the default case. They look like this:
MESSAGE TEXT. Line #: XX
where XX is the line number. We will define a unique string in
order to make this work with QCP.
Because of the way redirection occurs with DBCOMP, you need to
use a batch file to run the compiler. Here is DBC.BAT:
ECHO OFF
DBCOMP %1 -W -PF
COPY %1.ERR %2
DEL %1.ERR
The -PF switch redirects output to a file. This file always has
the same root name as the file being compiled, with an extension
of "ERR". The -W switch causes "warning" messages to also be
issued, which you may or may not desire. Use this line in
QCP.DAT:
.PRG "DBC $N $O","Line #:"
which sets both the unique string and the lead-in string to the
string "Line #:"
QCP 2.08 Documentation Page 21
It is important to use $N so that the ".ERR" can be appended in
the batch file. Also, make sure you have the DBFAST RAM-resident
"engine" loaded into memory before you enter QEdit, as it is NOT
RECOMMENDED to attempt to load it from inside QEdit, since it is
a TSR program.
NORTON GUIDES DATABASE COMPILER 1.04 |
------------------------------------ |
The tools supplied with the Norton Guides to create your own |
online help databases can be used with QCP. However, they |
require both redirection help and a special unique/lead-in |
string. |
Both of Norton's programs write the error messages to Standard |
Error. Put one of these two sets of lines in your QCP.DAT: |
.NGC "errout /f $O ngc $F" "Line " |
.NGM "errout /f $O ngml $F" "Line " |
.NGC "concopy $O ngc $F" "Line " |
.NGM "concopy $O ngml $F" "Line " |
Norton does not recommend particular extensions for the Database |
source files or the Menu Link Control files. For the sake of |
this example, we have adopted ".NGC" for the former and ".NGM" |
for the latter, feel free to change these to whatever default |
extensions you use. |
MICROSOFT QUICK PASCAL 1.00 |
--------------------------- |
Quick Pascal's command-line compiler also uses Standard Error to |
output error messages. Put one of the following two lines in |
your QCP.DAT: |
.PAS ERROUT /f $O qpl $F |
.PAS "CONCOPY $O qpl $F" "error P" "$N.$E" |
Quick Pascal issues "status messages" telling what line it is |
currently compiling, to the console, just as Turbo Pascal does. |
Unfortunately, unlike Turbo Pascal, Quick Pascal does not have a |
/Q switch to turn this off. |
As a result, if you use CONCOPY to redirect the output, you will |
get a number of bare carriage returns in the output. For this |
reason, we recommend you use the /W+ mode of QCP when compiling |
with Quick Pascal. When the error file is rewritten by QCP, the |
bare carriage returns will be converted to proper line breaks. |
QCP 2.08 Documentation Page 22
This is also the reason for the unusual Unique and Lead-in |
strings on the CONCOPY command line above. |
INCOMPATIBLE COMPILERS
----------------------
The following compilers cannot be made to work with QCP's macro
generation feature as far as we can tell. If applicable or
known, a reason is given after each. If you can figure out a way
to make one of these work, we'll be glad to add that information
to a future version of this DOC file.
A86 macro assembler, V3.20 (and earlier) by Eric Isaacson |
Error messages do not include line numbers. |
Microsoft Pascal, v3.32 and earlier |
Error messages are too inconsistently formatted. |
Ryan-McFarland FORTRAN version 2.4
Error messages do not include line numbers.
Turbo Pascal 3.0 and earlier
This compiler is an integrated environment only.
CONFIGURATION VIA QCP.DAT
-------------------------
QCP needs information on the file extensions and compilers you
use in order to do its job. You supply this information by
editing the file QCP.DAT to suit your individual circumstances.
In addition, various options in the way QCP behaves can be
controlled via lines in QCP.DAT. This includes those mentioned
above in the section on command line switches, but also some
others that you will normally change only rarely.
An example QCP.DAT, which contains the same values with which
QCP.EXE is shipped, is supplied. You can begin by editing this
file to suit your requirements.
The file is fairly free-form, you can incorporate comments more
or less at will. The only lines which QCP will try to process
are those that begin with a '.' (period) in column 1 and are
longer than 5 characters.
QCP 2.08 Documentation Page 23
The main content of QCP.DAT is a list of file name extensions,
followed by the command line that will be executed for each one,
as follows:
Ext. Default Command Line
---- --------------------
.asm masm $F; >$O
.c tcc -c $F >$O
and so on.
Note that the format of QCP.DAT was designed to be much the same
as that of QCOMP.DAT, from Mike Smedley's program. If you are
currently using QCOMP, you can adapt your current QCOMP.DAT
simply by renaming it, and editing all instances of '%s' into
'$F'.
It is legal to have an entry for a "nothing" file extension.
Just put a period by itself on a line, followed by at least one
space, and the command line to use.
Only the first 10 extensions found will be processed. Any
additional ones, or duplicate ones, will be ignored. A warning
message is issued to help you clean up your QCP.DAT.
The raw command lines may not be longer than 64 characters,
though they can become a full 127 characters long when the $
strings are expanded.
QCP executes a child copy of COMMAND.COM, which is passed the
command line to execute. This means that you can use internal
DOS commands, batch files and I/O redirection in invoking your
compiler. COMMAND.COM is found using the 'COMSPEC' environment
variable, make sure yours is set correctly. Putting COMMAND.COM
on a RAM disk and setting your COMSPEC variable to point to it
considerably speeds operation of QCP and other programs. See
your DOS manual for details.
QCP 2.08 Documentation Page 24
SUBSTITUTION STRINGS
--------------------
Various sub-strings, in the form of "$c" where c is some
character, can be included in compiler command lines, macro key
templates and the QMAC command line template (see below), in
order to substitute values at run-time. They can be included in
any order. Some make more sense than others in certain contexts,
as noted below:
$F -- FULL FILENAME
--------------------
Substitutes the full path name of the file passed on the command
line to QCP. This is expanded internally by QCP, so even if you
supply a partial path to the file, this will always be the fully
qualified path, in all caps. Note that directory references '.'
and '..' will be correctly removed from the path here (QEdit
doesn't currently do this as of version 2.08).
$D -- DRIVE LETTER
-------------------
Drive letter of the file passed. Just the drive letter, no
trailing ':' is included.
$P -- PATH (DIRECTORY) OF FILE
-------------------------------
Path to the file passed. This is a fully qualified path,
starting at the root, but not including the filename itself. The
leading '\' is included, but no trailing '\' is supplied. If the
file is in the root directory, this string will be the empty
string.
$N -- NAME OF FILE
-------------------
Name of the file. Just the 8-character name, with no delimiters.
$E -- EXTENSION OF FILE
------------------------
Extension of the file. Just the 3-character extension, with no
delimiters. No '.' is included. Can be an empty string if there
is no extension on the original file name.
Note: in all cases, '$F' is exactly equivalent to '$D:$P\$N.$E'.
Keep in mind that $P and $E can be empty strings, but $N, $D and
$F will always contain SOMETHING.
All of the filename-related parameters are capitalized by QCP, so
you need not worry about mixed case if you are examining the
parameters in a batch file. The file passed to QCP is not
checked for existence.
QCP 2.08 Documentation Page 25
$1 to $9 -- COMPILER OPTIONS
-----------------------------
Where x is a single digit from 1 to 9. This will expand to
command line parameters (if any) that were passed to QCP on the
command line, beyond the filename. Similar to %1 through %9 in
DOS Batch files.
$$ -- SINGLE DOLLAR SIGN
-------------------------
Expands to a single $ on the target command line or other string.
$T -- TEMP FILE NAME
---------------------
Expands to the name of the temp file to be created by QCP, as
input for QMAC. Defaults to $QCP$.TMP. After QMAC runs, this
file is deleted by QCP. You can configure it with the "..T"
command in QCP.DAT. It may include a full path specification.
This file is normally used only on the QMAC command line, and by
QCP internally.
$O -- OUTPUT FILE NAME
-----------------------
Expands to the name of the output file you want compiler output
directed to. Defaults to ERRORS.LST. Normally you include ">$O"
on the compiler command line to insure this file gets created.
You can change this file name with the "/O" command line switch
or the "..O" command in QCP.DAT. It may include a full path
specification. See /O above for details.
$M -- MACRO FILE NAME
----------------------
Expands to the name of the QEdit binary macro file created by
QMAC or QCP. Defaults to ERRORS.MAC. You can change this file
name with the "/M" command line switch or the "..M" command in
QCP.DAT. It may include a full path specification. See /M above
for details.
$K -- MACRO KEY NUMBER
-----------------------
Expands to the number of the macro key currently being generated.
This ranges from '1' through '0' if your macro key template
starts with just '@' (the default). If you macro key template
starts with anything else, this ranges from '1' to '12', so you
can find errors with your function keys (or Control-function, or
Alt-function, etc.).
This is ONLY used inside the macro key template(s), and will
expand to nothing if used anywhere else.
QCP 2.08 Documentation Page 26
$S -- SOURCE LINE NUMBER
-------------------------
Expands to the number of the line in your source code that
generated (this) error. Can be any valid number. This is also
only used inside macro key template(s).
$C -- SOURCE COLUMN NUMBER |
--------------------------- |
Expands to the number of the column (on the line $S) in your |
source code where the error occurred. Can be any valid |
number, less than 1000. If no column number was found in the |
error message, this will be the empty string. This is also only |
used inside macro key template(s). |
$R -- RESULT LINE NUMBER
-------------------------
Expands to the number of the line in the error output ($O) file
that contained this error message. Can be any valid number.
This is also only used inside macro key template(s).
The above three strings, $S, $C and $R, are used to position the
cursor in both windows on the source line, and the error message,
when back in QEdit. See the QEdit macro template string for an
example of their use.
$I -- INSERTED CHARACTER |
------------------------- |
Expands to a single character to be inserted immediately to the |
left of the source line and column numbers ($S and $C) where they |
appear in the error output. Normally this is CHR( 255 ), which |
is a blank character. You can set this by the /I command line |
option or the ..I command in QCP.DAT. |
This is usually only used in the next error and previous error |
macro templates, but in fact could be used anywhere in the |
program. |
$U -- UNIQUE STRING |
-------------------- |
Expands to the unique string being used to find error messages |
with the currently invoked compiler. |
QCP 2.08 Documentation Page 27
$L -- LEAD-IN STRING |
--------------------- |
Expands to the lead-in string being used with the currently |
invoked compiler. |
Both the Unique and Lead-in strings default to the name (plus |
extension if present) of the source file. Since they can contain |
$X expansion characters themselves, there is a danger of a |
circular reference here. The program takes this into account, |
but be sure you do not erroneously create one. |
They are normally used in the next error and previous error macro |
templates, to find error lines in the error output file. They |
are only valid during macro creation. |
Note that if any character other than those listed above appears
after a $ in any string, both the $ and the character will be
"eaten" by QCP and will not appear in the resulting string.
(This is for upward compatibility with possible future extensions
to the above list). If you need to put a $ in your compiler
command line or macro key template, use a double $ as indicated
above.
QCP CONFIGURATION COMMANDS
--------------------------
Some configuration commands can also be included in QCP.DAT to
customize QCP in special ways. They follow the same general form
as file extension lines: a line beginning with a period that is
longer than 5 chars. However, there is a second period to
distinguish these from file name extensions, followed by one
character to specify the operation, a space, and some string
argument.
You need not supply all or any of these commands in QCP.DAT, you
can mix and match as you see fit. Any that are not included will
default to the previously installed values in QCP.EXE. If more
than one of the same directive occurs in QCP.DAT, the last one
takes precendence.
..T filename -- TEMP FILE NAME
--------------------------------
Sets the name of the temporary file written by QCP and read by
QMAC to create macros. Defaults to $QCP$.TMP. Corresponds to
the "$T" substitution string.
QCP 2.08 Documentation Page 28
..O filename -- OUTPUT FILE NAME
----------------------------------
Sets the name of the output file to which compiler output is
redirected. Defaults to ERRORS.LST. Corresponds to the "$O"
substitution string. It can also be set by the /Ofilename
commmand line switch, which overrides the value set here.
..M filename -- MACRO FILE NAME
---------------------------------
Sets the name of the macro file to be generated by QMAC from the
key definitions created by QCP. Defaults to ERRORS.MAC.
Corresponds to the "$M" substitution string. It can also be set
by the /Mfilename commmand line switch, which overrides the value
set here.
For all three of the above files, note: Your temp directory, if
defined via the environment variable TMP, will be automatically
pre-pended to this file name if it does not already contain a
drive or path. This is done at RUN-TIME.
If this would cause the file not to match the name being used in
the QEdit macro key, then make sure that the file name contains a
drive or path to suppress use of TMP. You can use ".\" to put
these file in the current directory, the default.
..C commandline -- QMAC COMMAND LINE
--------------------------------------
Sets a template command line for invocation of QMAC from QCP.
Defaults to "QMAC $M $T B N". Like compiler command lines, this
command line is passed to a child copy of COMMAND.COM, so calling
batch files and I/O redirection is possible here.
One possible alteration to this command line would be to take |
advantage of the "append" capability that QMAC has. With QEdit |
2.08, it is now very easy to load a set of QMAC-style loadable |
macros, every time you use QEdit, by using the /L command line |
switch. Since QMAC macros can be considerably longer and more |
numerous than the ones permanently installed into QEdit by |
QCONFIG, this has some advantages. |
However, when you invoke QCP, and load the macro file it creates, |
your previously loaded macros are thrown away. You could |
overcome this by using QMAC's append mode. |
You could change the ..C command line to read: |
QM $M $T |
QCP 2.08 Documentation Page 29
And set up a batch file, QM.BAT, that contained the following: |
ECHO OFF |
COPY MYMACROS.MAC %1 |
QMAC %1 %2 B Y |
This would put a set of "default" macros, from MYMACROS.MAC, into |
the file ERRORS.MAC. Then, it invokes QMAC, causing the macros |
created by QCP to appended to your default macros in ERRORS.MAC. |
When you return from the compile, both your default macros, and |
any macros created by QCP, are reloaded into QEdit. |
..Q ON
..Q OFF
or
..Q macroline -- QEDIT MACRO TEMPLATE
---------------------------------------
The form with 'ON' or 'OFF' simply activates or deactivates the
creation of QEdit macro keys by QCP. If you do not wish to use
this feature, you can specify "..Q OFF", and no macros will ever
be created.
Specifying ON or OFF does not change the template macro
definition. If you turn macro creation OFF, and later turn it
back ON, your original macro template will still be intact.
If a string other than ON or OFF is specified after "..Q", it
sets the template QEdit macro definition to be generated. When
you set a template this way, macro generation is automatically
turned ON as well. The default is:
@$K MacroBegin |
NextWindow BegLine GotoLine "$R" Return MakeCtrOfScreen |
PrevWindow BegLine GotoLine "$S" Return |
GotoColumn "$C" Return MakeCtrOfScreen |
(Wrapped here for readability). This works in concert with the
default invocation macro (Control-F9) supplied in QCONFIG.QCP, to
scroll both windows (source file, and error listing) to each
error message in synch with each other.
The macro definition can be one or two lines long. If it is two |
lines long, simply end the first line with a "&" (ampersand) and |
continue the macro onto the second line, just as you do with |
QMAC. |
QCP 2.08 Documentation Page 30
The default generates a series of macros on ALT-1 through ALT-0
across the top of your keyboard. You could easily change this to
some other series of keys by changing the first few characters of
the macro template. Sensible values are:
Value Keys
---------------------- -------------------------
@$K MacroBegin.... Alt-1 to Alt-0 (Default)
f$K MacroBegin.... F1 to F12
#f$K MacroBegin.... Shift-F1 to Shift-F12
^f$K MacroBegin.... Control-F1 to Control-F12
@f$K MacroBegin.... Alt-F1 to Alt-F12
You will want to pick a series of keys that have no current
definitions in your QCONFIG.DAT, otherwise those definitions will
become inaccessible when the error macro file is loaded by QEdit.
..1 through ..9 -- SPECIAL FILE "EXTENSIONS"
----------------------------------------------
These work exactly like file extension definitions. These
correspond to the "/1" through "/9" command line options on QCP,
and allow you to override the default compiler or program that
would be invoked based on the target files file extension.
(NOTE: These have nothing at all to do with the "$1" through
"$9" substitution strings!).
A sample use of this is supplied in QCP.DAT:
..1 grep -o+n+r+ $1 $2 $3 $4 $5 $6 $7 $8 $9 $F >$O
This example is intended to work with Borland's Turbo Grep, which
is shipped with most of their current language products. The
command line switches may be different with other Grep's. Just
insure that the Grep you use produces Unix-style output with line
numbers.
This allows you to invoke QCP with
QCP /1 filename reg_expression_string
and regardless of the extension of the file used, GREP will be
invoked to search for the specified regular expression. The
beauty of this is that QCP can read the output generated by GREP,
convert it to macro keys, and allow you to jump to each line GREP
found using QEdit. The Control-F8 function key in QCONFIG.QCP is
set up to do this for you.
QCP 2.08 Documentation Page 31
Another sample use of this replaces the function of QMAKE by
Jerry Houston:
..2 make $N
you can replace "make" with the path and/or name of your
favorite make utility. The assumption here is that for each
source code file you have, you also have a MAKE file, with no
extension, containing the project definition. By using $N, we
pass just the root file name to make via QCP. The invocation of
this would look like: "QCP /2 filename". See QCONFIG.QCP.
..B ON |
..B OFF |
or |
..B macroline -- BATCH MODE STARTUP MACRO TEMPLATE |
--------------------------------------------------- |
This operation works just like the ..Q macro template--it turns |
batch mode macro creation on or off, and/or sets the QEdit macro |
template that will be used to create the startup macro. See also |
the /B switch above. |
The default for the ..B macro template, which is designed to |
work with the supplied COMPILE.BAT, is as follows: |
250 MacroBegin OneWindow EditFile "$F" Return |
HorizontalWindow EditFile "$O" Return |
BegLine GotoLine "$R" Return MakeCtrOfScreen |
PrevWindow BegLine GotoLine "$S" Return |
GotoColumn "$C" Return MakeCtrOfScreen |
(Wrapped here for readibility). This template may continue onto |
a second line in QCP.DAT, by ending the first line with "&". |
The purpose of batch mode and the startup macro is to use QCP |
from outside QEdit, and then only invoke QEdit AFTER compiling |
the source file. A sample batch file which takes advantage of |
this is supplied in COMPILE.BAT. |
The advantage to Batch mode is that you can use it with compilers |
that are extraordinarily memory-hungry, and therefore cannot be |
run while inside of QEdit. |
QCP 2.08 Documentation Page 32
Batch mode could also be used to implement a "smart make" |
procedure, in which the make process would stop and enter QEdit |
any time an error occurred. Merely by fixing and compiling the |
file in question while in QEdit, and then exiting, the make |
process would resume normally. You could use your normal |
command-line make utility to implement this, by having it invoke |
something similar to COMPILE.BAT for each target that has to be |
created. |
When macros are created, QCP exits with the DOS ERRORLEVEL set to |
one (1). If no errors were found (and therefore no macros |
created) the ERRORLEVEL is set to zero (0). This can be used in |
conjunction with batch mode to decide whether to invoke QEdit. |
See COMPILE.BAT for an example. (If some sort of error occurs, |
such as a missing file, or out of memory, QCP exits with the |
ERRORLEVEL set to 128 or greater). |
..G ON |
or |
..G OFF -- DEFAULT VALUE FOR GUESS EXTENSION |
--------------------------------------------- |
This command lets you set the default value for the /G command |
line switch. See /G for details. |
..W ON |
or |
..W OFF -- DEFAULT VALUE FOR REWRITE ERROR FILE |
------------------------------------------------ |
This command lets you set the default value for the /W command |
line switch. See /W for details. |
..I CHAR -- DEFAULT INSERTION CHARACTER |
---------------------------------------- |
This command lets you set the "insertion" character used in /W+ |
mode. See /I for details. |
The insertion character may be numeric or ASCII when specified |
here, and it must be separated from the ..I by at least one |
space. |
QCP 2.08 Documentation Page 33
..N macroline |
and |
..P macroline -- NEXT AND PREVIOUS ERROR MACRO TEMPLATES |
--------------------------------------------------------- |
These two templates allow you to set up generic "go to next |
error" and "go to previous error" macros for use with QCP. This |
is particularly useful with compilers that might generate more |
than ten or twelve error messages per run, and with external GREP |
or other utilities. |
The error output file has to be rewritten by QCP (/W+ must be |
active) for these macros to be written to the macro file. The |
macros take advantage of the insertion character added to the |
compiler output by QCP, to find the row and column numbers |
without any special knowledge of the format of the error |
messages (see /I for info on the insertion character). |
The default for the next error macro is as follows: |
#f10 MacroBegin NextWindow EndLine |
Find "$U" Return "I" Return BegLine |
Find "$I" Return "I" Return |
CursorRight MarkWord Copy |
PrevWindow GotoLine Paste Return |
NextWindow RepeatFind CursorRight MarkWord Copy |
BegLine MakeCtrOfScreen |
PrevWindow GotoColumn Paste Return MakeCtrOfScreen |
The default for the previous error macro is as follows: |
#f9 MacroBegin NextWindow BegLine |
Find "$U" Return "IB" Return BegLine |
Find "$I" Return "I" Return |
CursorRight MarkWord Copy |
PrevWindow GotoLine Paste Return |
NextWindow RepeatFind CursorRight MarkWord Copy |
BegLine MakeCtrOfScreen |
PrevWindow GotoColumn Paste Return MakeCtrOfScreen |
Just as with the other macro templates, these can continue onto a |
second line in QCP.DAT by ending the first line with "&". In |
fact, the definitions presented here are two lines long in the |
supplied QCP.DAT. |
QCP 2.08 Documentation Page 34
Here are some summaries of the various switches, parameters, etc.
that QCP understands:
SUMMARY OF QCP COMMAND LINE SWITCHES
------------------------------------
SWITCH MEANING TYPICAL VALUE
---------- ------------------------ --------------------------
/? or /H show Help screen
/B Batch mode /B+
/C Configure QCP /C or /CE:\MYDIR\MYQCP.EXE
/I set Insertion character /I255
/G set Guess extension mode /G+
/M set Macro file name /M.\errors.mac
/O set Output file name /O.\errors.lst
/P set Pause after error /P+
/Q set QEdit macro creation /Q+
/R Read config from QCP.DAT /R or /RE:\MYDIR\MYQCP.DAT
/S See defaults /S
/W set reWrite error file /W+
SUMMARY OF SUBSTITUTION STRINGS
-------------------------------
STRING MEANING TYPICAL VALUE
---------- ------------------------ --------------------------
$$ single dollar sign "$"
$1 to $9 Compiler options varies with compiler
$C source Column number "1"
$D Drive letter "C"
$E Extension of file "PAS"
$F Full filename "C:\LANG\TURBO\MYFILE.PAS"
$I Inserted character CHR( 255 )
$K macro Key number "1" through "0"
$L Lead-in string "MYFILE.PAS"
$M Macro file name ".\ERRORS.MAC"
$N Name of file "MYFILE"
$O Output file name ".\ERRORS.LST"
$P Path (directory) of file "\LANG\TURBO"
$R Result line number "3"
$S Source line number "124"
$T Temp file name "$QCP$.TMP"
$U Unique string "MYFILE.PAS"
QCP 2.08 Documentation Page 35
SUMMARY OF QCP.DAT CONFIGURATION COMMANDS
-----------------------------------------
STRING MEANING TYPICAL VALUE
---------- ----------------------- ---------------------------
..1 - ..9 Special "extensions" command line to execute
..B Batch mode macro "ON", "OFF", or valid macro
..C QMac Command line "QMAC $M $T B N"
..G Guess extension "ON" or "OFF"
..I Insertion character "255"
..M Macro file name ".\ERRORS.MAC"
..N Next error macro a valid macro
..O Output file name ".\ERRORS.LST"
..P Previous error macro a valid macro
..Q QEdit macro template "ON", "OFF", or valid macro
..T Temp file name "$QCP$.TMP"
..W reWrite error file "ON" or "OFF"
ERROR MESSAGES
--------------
Various error conditions can occur when QCP operates, in which
case it will issue the following error messages. Each of these
will be preceeded by "QCP Error:" to remind you that an error
condition has occurred, and followed by a console beep.
QCP.DAT cannot be found
or
QCP.EXE cannot be found
The data file or executable file could not be found in the
current directory, the directory the EXE came from, nor anywhere
along the path. These can occur as the result of using the /R or
/C command line switches.
d:\dir\QCP.EXE is corrupted or wrong version
You may have more than one QCP.EXE on your disk, or more than one
version of QCP present. If that is not true, your copy of QCP
may have been damaged due to disk error. Get a fresh copy from
your backup.
DOS error on execution of target command line
Some sort of DOS error (other than out of memory) occurred on
trying to load the child COMMAND.COM. This would be very rare,
but might be caused by an invalid COMSPEC environment variable,
or an invalid copy of COMMAND.COM.
QCP 2.08 Documentation Page 36
Error reading d:\dir\QCP.DAT
This means some sort of DOS error occurred while reading the data
file, either a bad sector, or premature EOF or something.
File name missing on /O or /M switch
You specified /O or /M on the QCP command line without putting a
filename immediately behind the switch (no spaces).
File name missing
After parsing out the various switches, QCP could not find an
actual file name to pass to your compiler.
I/O problem while attempting to write d:\dir\QCP.EXE
Some sort of DOS error occurred while rewriting the defaults in
QCP.EXE. This will only occur when you specify the /C command
line option. Your copy of QCP.EXE may have been damaged by this,
get a new copy off your backup disk.
Improper macro continuation line |
When specifying multi-line QEdit macros in QCP.DAT, by putting |
"&" on the end of the line, QCP does some rudimentary checking. |
If the continuation line begins with a period ("."), it will |
issue this message. It could also happen if the end of QCP.DAT |
was reached before finishing the macro. This can occur while |
reading any of the macro template commands in QCP.DAT. |
Insertion character missing on /I switch |
There was no text immediately behind the /I switch to use as an |
insertion character. You must follow the switch IMMEDIATELY with |
the character itself, or its decimal ASCII code, no space in |
between. |
No extensions found in d:\dir\QCP.DAT
No lines in the specified copy of QCP.DAT began with a '.', so
QCP could not find any extensions to parse.
No matching command line found for extension "xxx"
There was no extension/command line definition in QCP.DAT that
matched the extension of the file given on the command line (i.e.
"xxx"). If you specified /1 through /9 on the command line, then
there was no matching ..1 through ..9 command in your
configuration.
QCP 2.08 Documentation Page 37
Not enough memory to execute command line
There was not enough memory to load a child copy of COMMAND.COM
and execute your target command line.
Unrecognized command switch "x"
You specified a "/x" switch on the command line that QCP did not
recognize. Check the documentation for valid switches.
Only one of these errors will be displayed during any single run
of QCP. If any of these error messages were displayed, the DOS
ERRORLEVEL value will be set to 128 or higher when QCP exits.
INFORMATIVE & WARNING MESSAGES
------------------------------
QCP will also issue various informative messages during
operation. These will be preceded by "QCP:" for messages, or
"QCP Warning:" for warnings. No beep will sound, nor will the
ERRORLEVEL be set in these cases, as these are non-fatal
conditions. The "press any key to continue" prompt, if enabled,
will not appear after these messages.
Duplicate definition for "xxx" ignored
There is more than one definition line for extension "xxx" in
your QCP.DAT. Edit your QCP.DAT so that there is only one. If
you need to temporarily disable one definition to use another,
edit the line so that there is no "." in column 1, and QCP will
ignore that line.
Extension table full, extension "xxx" ignored
You have more than 10 extension/command line definitions in your
QCP.DAT, and QCP ran out of table space. "xxx" will be the 11th
or greater extension defined in the file. Edit your QCP.DAT so
that there are 10 or less definitions.
Macro file created for QEdit |
This message appears after QCP is done running QMAC to create a |
loadable binary macro file for QEdit. |
QCP 2.08 Documentation Page 38
New defaults written to d:\dir\QCP.EXE
This informs you that QCP has successfully re-written its
defaults as requested by /C, and where QCP.EXE was found.
Reading configuration from d:\dir\QCP.DAT
This message just informs you that a configuration is being read
to satisfy a /R or /C request, and it tells you where QCP.DAT was
found on the disk.
Unknown configuration command "..x" ignored |
QCP found a command named "..x" in your QCP.DAT, and did not |
recognize it. See elsewhere in this documentation for the list |
of supported configuration commands. |
Unmatched " in input line of d:\dir\QCP.DAT
QCP was trying to read in a command line followed by a unique
string and/or a lead-in string, and could not find a matching
quote character. Since you can mix and match single and double
quotes, double check your data file to be sure you paired them up
correctly.
ACKNOWLEDGEMENTS & CONTACTS
---------------------------
Source code to QCP is no longer available.
Special thanks to Tony Tortorelli, Randy Wallin, Gary Speegle,
David Chaika, Howard Kapustein and Sammy Mitchell for help in
tracking down particular compiler command lines that would work
with QCP. Also thanks to Mike Smedley and Jerry Houston for some
great ideas on which QCP is based.
QCP 2.08 Documentation Page 39
If you have any questions or suggestions, please contact:
SemWare
4343 Shallowford Road
Suite C-3
Marietta, GA 30062-5003
Voice Phone: (404) 641-9002 9 a.m to 5 p.m. E.T., Mon-Fri.
BBS Phone: (404) 641-8968, 2400 bps
REVISION HISTORY
----------------
Version 1.0 - 7-Feb-1989 - Initial release.
Version 2.0 - 15-Mar-1989 - Substantial revision.
Added internal defaults.
Added /R, /H, /? and /S command line switches.
Added self-configuration /C option.
Added construction of QMAC macros from error output.
Added support for environment variable 'TMP'.
Additional error checking and status messages.
Added "special extensions" for special-purpose macros
Added /M and /O cmd line options to make the
invocation macro more self-contained.
Added /Q, made boolean switches more consistent.
Documentation file significantly rewritten.
Version 2.08 - 17-Nov-1989 - Supports QEdit 2.08. |
Detects column number along with line number. |
Allows generic "next" and "previous" macros. |
Allows compilers to be run outside of QEdit, with |
the editor being invoked via an autoexecute macro. |
Pause after error messages. |
QEdit macros that QCP writes can now be two lines. |
Miscellaneous improvements. |
*** END ***